<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    1字符串去重,查询字符串个数
    <script>
        var a="weqwweqweqwewqeqweeqabc";
        for(var i=0;i<a.length;i++){
            // console.log(a[i]);
            var count=0;
            for(var j=i;j<a.length;j++){
                if(a[i]===a[j]){
                    count++
                }
            }
            if(a.indexOf(a[i])>=i){
                console.log(`${a[i]}出现了${count}次`);
            }
        }
        // var b=a.split("");
        // console.log(b);//数组
        // c=new Set(b);
        // console.log(c);//集合
        // var d=[...c];
        // console.log(d);//数组
        // var e=d.join("");
        // console.log(e);

        var ddd=new Set(a);
        console.log(ddd);
    </script>
</body>
</html>